Skip to content

Context menu shortcuts and sort dialog#759

Open
bgareth wants to merge 5 commits intoruilisi:masterfrom
bgareth:context-menu-shortcuts-and-sort-dialog
Open

Context menu shortcuts and sort dialog#759
bgareth wants to merge 5 commits intoruilisi:masterfrom
bgareth:context-menu-shortcuts-and-sort-dialog

Conversation

@bgareth
Copy link
Contributor

@bgareth bgareth commented Feb 24, 2026

The PR addresses a number of weaknesses:

  • A11y / keyboard shortcuts for context menu
  • Sort dialog visual and a11y issues

Related issue: #758

Changes include:

Keyboard shortcuts for context menus (selection-aware + explicit row/column)**

  • Added:
    • Cmd/Ctrl + Shift + M -> open context menu for current selection type
    • Cmd/Ctrl + Shift + R -> open row header context menu
    • Cmd/Ctrl + Shift + L -> open column header context menu
  • Reused existing context-menu open logic (handleContextMenu) and selection state
  • Updated SR shortcut list and locale strings

Key files:

[packages/react/src/components/Workbook/index.tsx](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/en.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/es.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/zh.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/zh_tw.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/hi.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/ru.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)

Context menu keyboard activation fix

  • Fixed keyboard activation so Enter on focused context menu item triggers the same path as mouse click

Key file:

[packages/react/src/components/ContextMenu/Menu.tsx](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)

Sort modal styling + accessibility fixes

  • Fixed text concatenation, eg: Sort range from G3 to G3 now renders with proper spacing.
  • Added spacing between Sort by and dropdown.
  • Capitalised sort confirm labels where needed (en, es).
  • Added Enter handling for sort confirm and dialog close.
  • Added dialog accessibility improvements:
    • role="dialog", aria-modal
    • label wiring to sort title
    • Focus trap
    • Escape to close

Key files:

[packages/react/src/components/CustomSort/index.tsx](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/react/src/components/CustomSort/index.css](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/react/src/components/Dialog/index.tsx](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/en.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)
[packages/core/src/locale/es.ts](https://file+.vscode-resource.vscode-cdn.net/Users/garethbeukes/.vscode/extensions/openai.chatgpt-0.4.76-darwin-arm64/webview/#)

Manual Test Checklist

  • Cell menu shortcut:
    • Select a cell/range, press Cmd+Shift+M, verify cell context menu opens
  • Row menu shortcut:
    • Select any cell in target row, press Cmd+Shift+R, verify row header menu opens
  • Column menu shortcut:
    • Select any cell in target column, press Cmd+Shift+L, verify column header menu opens
  • Context menu keyboard action:
    • Open context menu, tab to Insert 1 column right, press Enter, verify action runs and no runtime error
  • Sort modal spacing/text:
    • Open custom sort, verify title spacing (Sort range from X to Y) and Sort by spacing before dropdown
    • Sort modal keyboard:
      • Press Enter on Sort button -> apply sort
      • Press Enter on close icon -> close
      • Press Esc -> close
      • Tab/Shift+Tab cycles focus within dialog only

yarn eslint on touched files: pass
yarn tsc: pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant